package com.wei.remote;

import com.wei.entity.User;
import com.wei.fallback.UserControllerRemoteFallback;
import com.wei.fallback.UserControllerRemoteFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

@FeignClient(value = "springcloud-provice",
//熔断降流
fallback = UserControllerRemoteFallback.class,
//异常处理
fallbackFactory = UserControllerRemoteFallbackFactory.class
)
public interface UserControllerRemoteClient {
    /**
     * 声明一个Feign的接口，实现是消费者Controller的实现
     * @return
     */
    @GetMapping("/api/user/getOne")
    public User getOne();

    @GetMapping("/api/user/getValue")
    public String getValue();
}
